<%@tag pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@tag import="com.oplink.webems.modules.sys.entity.Config"%>
<tags:import includes="scroll,scrollCss"></tags:import>
<%@ attribute name="catalog" type="java.lang.String" required="false"%>
<%@ attribute name="withYesNo" type="java.lang.Boolean" required="false"%>
<%@ attribute name="width" type="java.lang.Integer" required="false"%>
<%@ attribute name="height" type="java.lang.Integer" required="false"%>
<!-- 当前所有字段名称 -->
<input class="fieldNameList" type="hidden"
	value="<c:forEach items="${fns:getModuleList(catalog)}" var="item">|${item.field}</c:forEach>" />
<!-- 修改变量值 -->
<input id="valListChanged" class="changedValueList" type="hidden"  value="" />
<input type="hidden" id="catalogName" value="${catalog}" />
<input type="hidden" id="formID" name="formID" uname="update" />
<div class="scrollPanel">
	<form class="form-horizontal" role="form">
		<c:forEach items="${fns:getModuleList(catalog)}" var="catalog">
			<%-- 非按钮 --%>
			<c:if test="${catalog.isEnable == '1' && catalog.fieldType != '10'}">
				<div class="space-4"></div>
				<div class="form-group">
					<label class="col-sm-3 control-label no-padding-right"
						for="form-field-2"> ${catalog.label} : </label>
			</c:if>
			<c:if test="${catalog.isEnable == '0' }">
				<input type="hidden" id="${catalog.field }" name="${catalog.field }"
					value="${catalog.value}" uname="update" />
			</c:if>
			<c:choose>
				<%-- 只读类型 --%>
				<c:when test="${ catalog.fieldType == '0' }">
					<div class="col-sm-6">
						<div class="paramText">
							<input id="${catalog.field}" name="${catalog.field}"
								uname="update" readOnly class="form-control"
								value="读取中......" />
						</div>
					</div>
				</c:when>
				<%--  时间 --%>
				<c:when test="${ catalog.fieldType == '1' }">
					<div class="col-sm-6">
						<div class="input-group bootstrap-timepicker">
							<input id="${catalog.field}" name="${catalog.field}"
								uname="update" class="form-control time-picker" type="text" />
							<span class="input-group-addon"> <i
								class="icon-time bigger-110"></i>
							</span>
						</div>
					</div>
					<button class="btn btn-info  btn-sync button test" type="button">
						<i class="icon-flag bigger-110"></i> 同步
					</button>
					<button class="btn btn-success btn-reset" type="button">
						<i class="icon-undo bigger-110"></i> 重置
					</button>
				</c:when>
				<%--  日期 --%>
				<c:when test="${ catalog.fieldType == '2' }">
					<div class="col-sm-6">
						<div class="input-group">
							<input id="${catalog.field}" name="${catalog.field}"
								uname="update" class="form-control date-picker" type="text"
								data-original-title="" title="" data-date-format="yyyy-dd-mm" />
							<span class="input-group-addon"> <i
								class="icon-calendar bigger-110"></i>
							</span>
						</div>
					</div>
					<button class="btn btn-info  btn-sync button test" type="button">
						<i class="icon-flag bigger-110"></i> 同步
					</button>
					<button class="btn btn-success btn-reset" type="button">
						<i class="icon-undo bigger-110"></i> 重置
					</button>
				</c:when>
				<%--  带单位 --%>
				<c:when test="${ catalog.fieldType == '3' }">
					<div class="col-sm-6">
						<div class="input-group">
							<input class="form-control" 
								id="${catalog.field}"
								name="${catalog.field}" 
								uname="update"
								data-placement="left" 							
								data-content="远程参数和本地数据不同步，请同步。"
								utype="${ catalog.fieldType}" 
								uunit="${catalog.ext_1}"
								<c:if test="${catalog.readOnly == '1'}">readOnly="readOnly"</c:if>
								value="${catalog.defaultValue}" /> <span
								class="input-group-addon">&nbsp;${catalog.formatStr}&nbsp;</span>
						</div>
					</div>
					<button class="btn btn-info  btn-sync button test" type="button">
						<i class="icon-flag bigger-110"></i> 同步
					</button>
					<button class="btn btn-success btn-reset" type="button">
						<i class="icon-undo bigger-110"></i> 重置
					</button>
				</c:when>
				<%--  字典控件 --%>
				<c:when test="${ catalog.fieldType == '7' }">
					<div class="col-sm-6">
						<div class="paramText">
							<widgets:select 
								datasource="${fns:getDictList(catalog.ext_1)}"
								width="330" 
								utype="${ catalog.fieldType}" 
								uname="update"
								dictName="${catalog.field}" 
								dataPlaceholder="字典类型">
							</widgets:select>
						</div>
					</div>
				</c:when>
				<%--  文本 --%>
				<c:when
					test="${ catalog.fieldType == '8' && catalog.isEnable == '1'}">
					<div class="col-sm-6">
						<div class="input-group">
							<span class="input-icon block input-icon-right"> <input
								class="form-control" style="width: 418px" data-rel="popover"
								data-placement="left" data-content="远程参数和本地数据不同步，请同步。"
								id="${catalog.field}" name="${catalog.field}"
								<c:if test="${catalog.readOnly == '1'}">readOnly="readOnly"</c:if>
								uname="update" value="${catalog.value}" />
							</span>
						</div>
					</div>
					<button class="btn btn-info  btn-sync button test" type="button">
						<i class="icon-flag bigger-110"></i> 同步
					</button>
					<button class="btn btn-success btn-reset" type="button">
						<i class="icon-undo bigger-110"></i> 重置
					</button>
				</c:when>
				<%--  父级节点 --%>
				<c:when test="${ catalog.fieldType == '9' }">
					<div class="col-sm-9">
						<div class="input-group" style="width: 281px; height: 10px;">
							<input class="form-control" id="callbackName"
								name="${catalog.field}" type="text" name="${catalog.field}"
								uname="update" value="父级节点" style="height: 29px;"> <span
								id="btnSelectTree" class="input-group-addon"
								style="cursor: hand;"> <i class="icon-search bigger-110"></i>
							</span>
						</div>
					</div>
				</c:when>
				<%--  按钮 --%>
				<c:when test="${ catalog.fieldType == '10' }">
					<div class="alert alert-danger">
						<h4>警告!</h4>
						请确认是否重启设备，未保存的配置将丢失。
					</div>
					<div class="clearfix form-actions text-center">
						<div class="col-sm-9">
							<button id="${catalog.field}" name="${catalog.field}"
								class="btn btn-info btn-confirm" type="button">
								<i class="icon-ok bigger-110"></i> ${catalog.label}
							</button>
						</div>
					</div>
				</c:when>

				<%--  字典翻译 --%>
				<c:when test="${ catalog.fieldType == '11' }">
					<div class="col-sm-6">
						<div class="paramText">
							<input id="${catalog.field}" name="${catalog.field}"
								uname="update" utype="${ catalog.fieldType}"
								class="form-control" readOnly />
						</div>
					</div>
				</c:when>
			</c:choose>
			<c:if test="${catalog.isEnable == '1' }">
</div>
</c:if>
</c:forEach>
</form>
</div>
